package com.example.partner.service;

import com.example.partner.common.BaseResponse;
import com.example.partner.common.Page;
import com.example.partner.model.domain.User;
import com.example.partner.model.request.UserLoginRequest;
import com.example.partner.model.request.UserRegisterRequest;
import com.example.partner.model.vo.UserVo;

import java.util.List;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

//http://10.0.0.2:8080/api/user/register
public interface UserService {
    @POST("api/user/register")
    Call<BaseResponse<Long>> userRegister(@Body UserRegisterRequest request);
    @POST("api/user/login")
    Call<BaseResponse<User>> userLogin(@Body UserLoginRequest request);

    @GET("api/user/findByAccount")
    Call<BaseResponse<User>> findByAccount(@Query("userAccount") String userAccount);

    @GET("api/user/match")
    Call<BaseResponse<List<User>>> matchUsers(@Query("userId") Long userId,@Query("num") Long num);

    @POST("api/user/searchPage")
    Call<BaseResponse<Page<User>>> userSearch(@Query("searchText") String searchText);


    @GET("/api/user/current")
    Call<BaseResponse<User>> getCurrentUser(@Query("userId") Long userId);

    @POST("api/user/update")
    Call<BaseResponse<Integer>> updateUser(@Body User user);
    @POST("api/user/logout")
    Call<BaseResponse<Integer>> logout();

    @POST("api/user/findByAccount")
    Call<BaseResponse<User>> getUserInfo(@Query("userAccount") String userAccount);

    @GET("api/user/near")
    Call<BaseResponse<List<UserVo>>> searchUserByDistance(@Query("pageSize") Long pageSize, @Query("pageNum") Long pageNum, @Query("x") Double x, @Query("y") Double y);
}
